import request from '@/utils/request'


export function getMeetingRoomBookingAll(pageNum,pageSize,MeetingroombookingVo) {
  return request({
    url: `/administrative/getMeetingRoomBookingAll/${pageNum}/${pageSize}`,
    method: 'get',
    data:MeetingroombookingVo
  })
}

export function getMeetingRoomAll(pageNum,pageSize,MeetingroombookingVo) {
  return request({
    url: `/administrative/getMeetingRoomAll/${pageNum}/${pageSize}`,
    method: 'get',
    data:MeetingroombookingVo
  })
}

export function deleteMeetingRoomBooking(id) {
  return request({
    url: `/administrative/deleteMeetingRoomBooking/${id}`,
    method: 'delete',
  })
}

export function addMeetingRoomBooking(Meetingroombookings) {
  console.log(Meetingroombookings)
  return request({
    url: `/administrative/addMeetingRoomBooking`,
    method: 'Post',
    data:Meetingroombookings
  })
}




// 解决ERROR ResizeObserver loop completed with undelivered notifications.
// 重写ResizeObserver的构造函数，并在其中定义并调用防抖函数
window.ResizeObserver = class ResizeObserver extends window.ResizeObserver {
  constructor(callback) {
    let timer = null;
    const debouncedCallback = function () {
      let context = this;
      let args = arguments;
      clearTimeout(timer);
      timer = setTimeout(function () {
        callback.apply(context, args);
      }, 16);
    };
    super(debouncedCallback);
  }
};
